import storage from '@/libs/storage';
import util from '@/libs/util';

const app = {
    state: {
        backUrl: ''
    },

    mutations: {
        setBackUrl (state, url) {
            if (url.indexOf('/device/detail') >= 0) {
                storage.set('backUrl', url);
                state.backUrl = url;
            }
        },
    },

    actions: {
        setBackUrl ({ commit }, url) {
            commit('setBackUrl', url);
        },
    }
};

export default app;
